package com.iotsz.user.service.impl;

import com.iotsz.user.bean.User;
import com.iotsz.user.mapper.UserMapper;
import com.iotsz.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public User getUser(Integer id) {
        return userMapper.getUser(id);
    }

    @Override
    @Transactional
    public Integer addUser(User user) {
        return userMapper.addUser(user);
    }

    @Override
    @Transactional
    public Integer updateUser(User user) {
        return userMapper.updateUser(user);
    }

    @Override
    public Integer deleteUser(Integer id) {
        return userMapper.deleteUser(id);
    }


}
